class WelcomeController < ApplicationController
  def index
    #热门游戏
    @topGameFiles = GameFile.order(game_level: :desc).order(created_at: :desc).limit(12).where("state = 1 and game_level > 2")
    #热门游戏
    @hotGameFiles = GameFile.order(click_num: :desc).order(created_at: :desc).limit(12).where(state: 1)
    #最新游戏
    @newGameFiles = GameFile.order(created_at: :desc).limit(12).where(state: 1)
  end
  def all
    #所有游戏
    @allGameFiles = GameFile.order(click_num: :desc).order(created_at: :desc).where(state: 1)
  end
end
